<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" media="screen"
	href="css/ui.jqgrid.css" />
<link rel="stylesheet" type="text/css" media="screen"
	href="css/jquery-ui-1.10.4.custom.min.css" />
	
<script src="js/jquery.min.js" type="text/javascript"></script>
<script src="js/grid.locale-cn.js" type="text/javascript"></script>
<script src="js/jquery.jqGrid.js" type="text/javascript"></script>

<script type="text/javascript">
$(function(){
	var rowNum=4; //每页显示记录数  
	var nowPage=1; //当前页
	jQuery("#list4").jqGrid(
			{
			    datatype : "local",
			    colNames:['用户名', '角色','登陆时间'],   
		        colModel:[     
		            {name:'name',index:'name', width:15,editable:true}, 
		            {name:'active',index:'active', width:15,editable:true}, 
		            {name:'createdDate',index:'createdDate',width:20,editable:true},       
		        ],   
		        rowNum:4,//每页显示记录数   
		        viewrecords: true, //是否显示行数   
		        //rowList:[4,8,12], //可调整每页显示的记录数   
		        multiselect: false, //是否支持多选   
		        caption: "最近登录",  
				width: '200',
				height:'100%'
			});	
	
	var mydata = [
		      		{name:"张三",active:"李四",createdDate:"2014-10-16 13:52:30"},
		      		{name:"张三",active:"李四",createdDate:"2014-10-16 13:52:30"}
		      		
		      		];
		for(var i=0;i<=mydata.length;i++){
			jQuery("#list4").jqGrid('addRowData',i+1,mydata[i]);
		}
})

function information(a,b,c){
	return "<img style='height:25px;' src='people.png'>";
}
</script>
</head>
<body>
<table id="list4"></table>


</body>
</html>